package org.micro.frame.um.controller;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import org.micro.frame.um.api.MemberFeignApi;
import org.micro.frame.um.entity.Member;
import org.micro.frame.um.service.IMemberService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * The Member Controller.
 *
 * @author lry
 */
@RestController
public class MemberController implements MemberFeignApi {

    @Resource
    private IMemberService memberService;

    @Override
    public Member findMemberById(Long id) {
        Member member = new Member();
        member.setEmail("595208882@qq.com");
        return member;
    }

    @Override
    public List<Member> findAll() {
        return memberService.selectList(new EntityWrapper<>());
    }

    @Override
    public Integer addMember(@RequestBody Member member) {
        return memberService.addMember(member);
    }

}
